See Original text in context
multi sub trait_mod:<is>(Attribute , :!)
By default, this trait allows setting up a private attribute during object construction via .new
. The same trait can be used to prevent setting up a public attribute via .new
by passing it the Boolean value False
.
my = Foo.new(bar => 1, baz => 2);say .bar; # «1»say .baz; # «Any»